﻿// -----------------------------------------------------------------------------
// Generate By Furion Tools v3.0.6                            
// -----------------------------------------------------------------------------

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using HOPU.OnlineSchool.Core;

namespace HOPU.OnlineSchool.Core
{
    public partial class EduChapter : IEntity<MasterDbContextLocator>, IEntityTypeBuilder<EduChapter, MasterDbContextLocator>
    {
    
        public string Id { get; set; }
        public string CourseId { get; set; }
        public string Title { get; set; }
        public int Sort { get; set; }
        public DateTime GmtCreate { get; set; }
        public DateTime GmtModified { get; set; }
    
        public void Configure(EntityTypeBuilder<EduChapter> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
                entityBuilder.ToTable("edu_chapter");

                entityBuilder.HasComment("课程");

                entityBuilder.HasIndex(e => e.CourseId, "idx_course_id");

                entityBuilder.Property(e => e.Id)
                    .HasMaxLength(19)
                    .HasColumnName("id")
                    .IsFixedLength(true)
                    .HasComment("章节ID");

                entityBuilder.Property(e => e.CourseId)
                    .IsRequired()
                    .HasMaxLength(19)
                    .HasColumnName("course_id")
                    .IsFixedLength(true)
                    .HasComment("课程ID");

                entityBuilder.Property(e => e.GmtCreate)
                    .HasColumnName("gmt_create")
                    .HasComment("创建时间");

                entityBuilder.Property(e => e.GmtModified)
                    .HasColumnName("gmt_modified")
                    .HasComment("更新时间");

                entityBuilder.Property(e => e.Sort)
                    .HasColumnType("int unsigned")
                    .HasColumnName("sort")
                    .HasComment("显示排序");

                entityBuilder.Property(e => e.Title)
                    .IsRequired()
                    .HasMaxLength(50)
                    .HasColumnName("title")
                    .HasComment("章节名称");
        }

    }
}
